package adapter;

/**
 * 适配器：
 * 调用filter前做前置校验
 * filter方法内做方法变更
 */
public class Adapter extends TargetAbstraction {
    private OhterClass ohterClass;

    public Adapter(OhterClass ohterClass) {
        this.ohterClass = ohterClass;
    }
    @Override
    public String filter(String str) {
        //方法前置校验
        ohterClass.preCheck(str);
        return str.replace("[","{");
    }
}
